#ifndef __VDEC_IMPL_H__
#define __VDEC_IMPL_H__

#include "includes.h"
#include "sys_impl.h"
#include "rk_mpi.h"
#include "mpp_buffer.h"
#include "mpp_packet.h"
#include "mpp_err.h"
#include "mpp_frame.h"

#ifdef __cplusplus
extern "C" {
#endif

#define MAX_VDEC_DEV_NUM 1

typedef struct trMPP_VDEC_CHANNEL_S {
    BOOL bEnable;
    int32_t s32ChnId;
    VDEC_CHN_ATTR_S stAttr;

    MppCtx ctx;
    MppApi *mpi;
    MppBufferGroup frm_grp;
    MppPacket packet;

    BOOL bStartRecv;
    pthread_mutex_t mutex;

    ////实时数据
    uint32_t u32Width;
    uint32_t u32Height;
    PIXEL_FORMAT_E enPixelFormat;
    VPSS_FRAME_RATE_S stFrameRate;
    /////

    void *pReversePtr;
} MPP_VDEC_CHANNEL_S;

typedef struct trMPP_VDEC_S
{
    MOD_ID_E enModId;
    char strModName[32];
    uint32_t u32DevId;

    int32_t s32CodecType;
    int32_t s32MaxChnNum;
    int32_t s32CurChnNum;
    MPP_VDEC_CHANNEL_S *pstChannels;

    PIN_DATA_S stPinData;
} MPP_VDEC_S;

int TR_VDEC_Module_Init();
int TR_VDEC_Module_DeInit();

#ifdef __cplusplus
}
#endif

#endif